import { ApiProperty } from '@nestjs/swagger'
import { IsNotEmpty, IsNumber, IsNumberString, IsPositive } from 'class-validator'

export class OrderCreateDto {
  @ApiProperty({ description: '订单价格' })
  @IsNotEmpty({ message: '订单价格不能为空' })
  @IsNumber({}, {
    message: '价格必须是数字类型'
  })
  @IsPositive({ message: '金额必须大于0' })
  fOrderPrice: number;

  @ApiProperty({ description: '产品ID' })
  @IsNotEmpty({ message: '产品ID不能为空' })
  @IsNumberString({}, { message: '产品ID应该为数字' })
  fProductId: string;
}